From: Debian Science Maintainers Date: Tue, 9 Dec 2025 11:19:37 +0000 (+0000) Subject: Be compatible with Python 3.14 X-Git-Tag: archive/raspbian/2.3.3+dfsg-3+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ea7835b8f358422c4145ac871ca3ca1a147a20ec;p=pandas.git Be compatible with Python 3.14 Accept new (Python 3.14) wording of error messages Ignore some ResourceWarnings Author: Rebecca N. Palmer Bug-Debian: https://bugs.debian.org/1121955 Forwarded: no Gbp-Pq: Name python3p14_compat.patch --- diff --git a/pandas/tests/computation/test_eval.py b/pandas/tests/computation/test_eval.py index e9f7016b..cbcef840 100644 --- a/pandas/tests/computation/test_eval.py +++ b/pandas/tests/computation/test_eval.py @@ -177,7 +177,7 @@ class TestEval: r"only list-like( or dict-like)? objects are allowed to be " r"passed to (DataFrame\.)?isin\(\), you passed a " r"(`|')bool(`|')", - "argument of type 'bool' is not iterable", + "argument of type 'bool' is not (a container or )?iterable", ] ) if cmp_op in ("in", "not in") and not is_list_like(rhs): @@ -222,7 +222,7 @@ class TestEval: r"only list-like( or dict-like)? objects are allowed to be " r"passed to (DataFrame\.)?isin\(\), you passed a " r"(`|')float(`|')", - "argument of type 'float' is not iterable", + "argument of type 'float' is not (a container or )?iterable", ] ) if is_scalar(rhs) and op in skip_these: @@ -1092,7 +1092,7 @@ class TestOperations: ex3 = f"1 {op} (x + 1)" if op in ("in", "not in"): - msg = "argument of type 'int' is not iterable" + msg = "argument of type 'int' is not (a container or )?iterable" with pytest.raises(TypeError, match=msg): pd.eval(ex, engine=engine, parser=parser) else: diff --git a/pandas/tests/io/test_html.py b/pandas/tests/io/test_html.py index d5e8f106..901ded32 100644 --- a/pandas/tests/io/test_html.py +++ b/pandas/tests/io/test_html.py @@ -389,6 +389,7 @@ class TestReadHtml: @pytest.mark.slow @pytest.mark.network @pytest.mark.single_cpu + @pytest.mark.xfail(reason="404 object not cleaned up in python 3.14",raises=pytest.PytestUnraisableExceptionWarning,strict=False) def test_invalid_url(self, httpserver, flavor_read_html): httpserver.serve_content("Name or service not known", code=404) with pytest.raises((URLError, ValueError), match="HTTP Error 404: NOT FOUND"): diff --git a/pandas/tests/io/xml/test_xml.py b/pandas/tests/io/xml/test_xml.py index 58bec396..f9785850 100644 --- a/pandas/tests/io/xml/test_xml.py +++ b/pandas/tests/io/xml/test_xml.py @@ -520,6 +520,7 @@ def test_url(httpserver, xml_file): @pytest.mark.network @pytest.mark.single_cpu +@pytest.mark.xfail(reason="404 object not cleaned up in python 3.14",raises=pytest.PytestUnraisableExceptionWarning,strict=False) def test_wrong_url(parser, httpserver): httpserver.serve_content("NOT FOUND", code=404) with pytest.raises(HTTPError, match=("HTTP Error 404: NOT FOUND")):